package gui.components.JXTable.test;

import gui.components.JXTable.sunPackage.TableSorter;

import javax.swing.*;
import javax.swing.table.DefaultTableModel;
import java.util.Vector;

/**
 * User: Programmer
 * Date: 10.05.2006
 * Time: 9:23:52
 */
public class testJXTableModel extends JFrame{
    DefaultTableModel model = new DefaultTableModel();
    TableSorter ts = new TableSorter(model, new JLabel());
    JTable table = new JTable(ts);
    JScrollPane scp = new JScrollPane(table);
    public testJXTableModel(){
        Vector v = new Vector();
        v.add("n1");
        v.add("n2");
        v.add("n3");
        /*TableColumn col = new TableColumn();
        this.table.getColumnModel().addColumn(col);
        col.setHeaderValue("79789");
        this.table.getColumnModel().addColumn(new TableColumn());
        this.table.getColumnModel().addColumn(new TableColumn());*/
        model.setColumnIdentifiers(v);

        model.addRow(new Object[]{"1","2","1"});
        model.addRow(new Object[]{"2","2","1"});
        model.addRow(new Object[]{"2","2","2"});

        //col.setPreferredWidth(230);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.getContentPane().add(scp);
        this.pack();
        this.setVisible(true);
    }

    public static void main(String[] args){
        new testJXTableModel();
    }
}
